import os, time
from django.shortcuts import redirect, render, HttpResponse
from django.views import View
from django.conf import settings
from django.utils import timezone

from mysqldb.models import AllinpayUserList, AllinpayAuthGroup, AllinpayTermList

# from django.contrib.admin import AdminSite


# class CustomAdminSite(AdminSite):
#     def index(self, request, extra_context=None):
#         app_dict = self._build_app_dict(request)
#         # 自定义对app_dict的处理
#         ordered_app_list = self.custom_order(app_dict)
#         # 将自定义排序后的app_list赋值给context变量，以便在前端模板中访问
#         context = {"app_list": ordered_app_list}
#         return self.index_template or "admin/index.html", context, self.current_app


class hello(View):
    def get(self, request):
        # return HttpResponse(f"<h3>网站建设中...</h3><p>{x}</p><span>渝ICP备20008438号-2</span>")
        html = """
        <a href="/docs/"> 文档 </a>
        """
        # return redirect("/docs/")
        # return HttpResponse("GET 方法").
        return render(request, "index.html")

    def post(self, request):
        return HttpResponse("POST 方法")


# print("[启动中] Start Install DefaultDB...")

# print(settings.CONF)

# x = AdminSite()
# print(x.index())
